import request from '@/config/axios'

// 检验记录-详情 VO
export interface InspectionRecordDetailsVO {
  id: number // 主键id
  recordId: number // 检测记录id
  itemId: number // 项目id
  itemCode: string // 项目code
  itemName: string // 项目名称
  detectionValue: string // 检测值
  status: string // 检测结果
}

// 检验记录-详情 API
export const InspectionRecordDetailsApi = {
  // 查询检验记录-详情分页
  getInspectionRecordDetailsPage: async (params: any) => {
    return await request.get({ url: `/opticore/inspection-record-details/page`, params })
  },

  // 查询检验记录-详情详情
  getInspectionRecordDetails: async (id: number) => {
    return await request.get({ url: `/opticore/inspection-record-details/get?id=` + id })
  },

  // 新增检验记录-详情
  createInspectionRecordDetails: async (data: InspectionRecordDetailsVO) => {
    return await request.post({ url: `/opticore/inspection-record-details/create`, data })
  },

  // 修改检验记录-详情
  updateInspectionRecordDetails: async (data: InspectionRecordDetailsVO) => {
    return await request.put({ url: `/opticore/inspection-record-details/update`, data })
  },

  // 删除检验记录-详情
  deleteInspectionRecordDetails: async (id: number) => {
    return await request.delete({ url: `/opticore/inspection-record-details/delete?id=` + id })
  },

  // 导出检验记录-详情 Excel
  exportInspectionRecordDetails: async (params) => {
    return await request.download({ url: `/opticore/inspection-record-details/export-excel`, params })
  },
}
